package com.altekis.kanbankaze.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.Widget;

public class BusyIndicatorView extends PopupPanel implements BusyIndicatorPresenter.Display {
	
	private static BusyIndicatorViewUiBinder uiBinder = GWT
			.create(BusyIndicatorViewUiBinder.class);

	interface BusyIndicatorViewUiBinder extends UiBinder<Widget, BusyIndicatorView> {
	}

	@UiField
	Label label;
		
	public BusyIndicatorView() {
		uiBinder.createAndBindUi(this);
		setAnimationEnabled(false);
		add(label);
	}

	public void showIndicator(String text) {
		label.setText(text);
		this.show();
	}
	
	public void hideIndicator() {
		label.setText("");
		this.hide();
	}
}
